package zju.ccnt.rest.domain;

import org.springframework.data.annotation.Id;
import zju.ccnt.rest.api.ApiCreateBusinessResource;
import zju.ccnt.rest.service.util.constant.ResourceActionType;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import java.sql.Timestamp;

/**
 * Created by zha on 14/11/28.
 */
@Entity
public class ResourceAction extends BaseEntity{
    private String userId;
    private String resourceId;
    private Timestamp date;
    @Enumerated(EnumType.STRING)
    private ResourceActionType action;

    public ResourceAction(){super();}

    public ResourceAction(String resourceId, ResourceActionType action, String uploader){
        super();
        this.userId = uploader;
        this.resourceId = resourceId;
        this.date = new Timestamp(System.currentTimeMillis());
        this.action = action;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getResourceId() {
        return resourceId;
    }

    public void setResourceId(String resourceId) {
        this.resourceId = resourceId;
    }

    public Timestamp getDate() {
        return date;
    }

    public void setDate(Timestamp date) {
        this.date = date;
    }

    public ResourceActionType getAction() {
        return action;
    }

    public void setAction(ResourceActionType action) {
        this.action = action;
    }
}
